import { modelOptions, prop, Severity } from "@typegoose/typegoose";
import { DoucumentStatus } from "../types/common.type";
import { getUid } from "../util/common.method";

@modelOptions({
  schemaOptions: {
    timestamps: {
      createdAt: 'created',
      updatedAt: 'updated',
    },
    id: false
  },
  options: {
    allowMixed: Severity.ALLOW
  }
})
export class Base {

  @prop({ default: () => getUid() })
  uid: string;

  @prop({ default: DoucumentStatus.Normal, select: false })
  status: DoucumentStatus;
}